//导入fs
const fs = require('fs');
const path = require('path');

// 两种写法
console.log(path.resolve(__dirname, './index.html')); // E:\Code\WebStorm\KuangStudy_Nodejs\04_path\index.html
console.log(path.resolve(__dirname, 'index.html')); // E:\Code\WebStorm\KuangStudy_Nodejs\04_path\index.html